package com.example.motion.dao;

import com.example.motion.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {

    @Select(" select * from user where name = #{name} and office_code = #{officeCode} ")
    User findUserByPoliceInfo(@Param("name") String name, @Param("officeCode") String officeCode);

    @Select(" select * from user where openid = #{openid} ")
    User findUserByOpenid(@Param("openid") String openid);

    @Update(" update user set openid=#{openid}, avatar=#{avatar}, edit_time=now() where id=#{id} ")
    void updateOpenid(User user);

}
